class CategoriesController < ApplicationController
	before_filter	:set_category
	before_filter :login_required, :except => [:show]
	
  def show 
  end

  def edit
  end

  def update
    params[:category][:datasheet_ids] ||= []

    respond_to do |format|
      if @category.update_attributes(params[:category])
        flash[:notice] = 'Category was successfully updated.'
        format.html { redirect_to category_url(@category) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @category.errors.to_xml }
      end
    end
  end

	private
	def set_category
		@category = Category.find(params[:id])
	end
end
